/**
  ******************************************************************************
  * @file    user_freertos.c
  * @version V1.0.0.180113_Beta
  * @date    2018.01.13
  * @author  bigvan_tech  
  * @brief   Source code for freertos applications.
  ******************************************************************************
  * @note
  *
  * E-mail：bigvan_tech@126.com
  * Change Logs:
  * ----------------------------------------------------------------
  * Date        Version                 Author         Description
  * --------    --------------------    -----------    -------------
  * 20180113    V1.0.0.180113_Beta     	bigvan_tech    Tested.
  *
  ******************************************************************************  
  */

/* Includes ------------------------------------------------------------------*/
#include "user_freertos.h"

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
void vTask0(void *pvParameters);
void vTask1(void *pvParameters);
void vTask2(void *pvParameters);

/* Exported functions --------------------------------------------------------*/
/**
  * @brief  Create tasks.
  * @param  None
  * @retval None
  */
void AppTaskCreate(void)
{
	/* Create Task0 at priority 1. */
	xTaskCreate(vTask1,
							"Task0",
							128,
							NULL,
							1,
							NULL);
	
	/* Create Task1 at priority 1. */
	xTaskCreate(vTask1,
							"Task1",
							128,
							NULL,
							1,
							NULL);
	
	/* Create Task2 at priority 1. */
	xTaskCreate(vTask2,
							"Task2",
							128,
							NULL,
							1,
							NULL);
}

/* Private functions ---------------------------------------------------------*/
/**
  * @brief  The implementation of Task0. 
  * @param  pvParameters: Task functions accept a parameter of type void*.
  * @retval None
  */
void vTask0(void *pvParameters)
{
	for( ;; )
	{
		HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_RESET);
		HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET);
		HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET);
	}
}

/**
  * @brief  The implementation of Task1. 
  * @param  pvParameters: Task functions accept a parameter of type void*.
  * @retval None
  */
void vTask1(void *pvParameters)
{
	for ( ;; )
	{	
		HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_SET);
		HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET);
		HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET);
	}
}

/**
  * @brief  The implementation of Task2.  
  * @param  pvParameters: Task functions accept a parameter of type void*.
  * @retval None
  */
void vTask2(void *pvParameters)
{
	for ( ;; )
	{			
		HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_SET);
		HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET);
		HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET);		
	}
}
/********************************END OF FILE***********************************/
